#include <QCoreApplication>
#include "g_ver.h"
#include "Launcher.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    a.setApplicationName(SP_NAME);
    a.setApplicationVersion(SP_VERSION);
    QDir::setCurrent(a.applicationDirPath());

    Launcher w;
    w.start();

    QStringList items=a.arguments();
    if(items.size() == 3)
    {
        if(items.at(1) == "-d")
        {
            QString dlCode=items.at(2).trimmed();
            if(!dlCode.isEmpty())
                w.testDL(dlCode);
        }
        else if(items.at(1) == "-e")
        {
            QString tid=items.at(2).trimmed();
            if(!tid.isEmpty())
                w.testEB(tid);
        }
        else if(items.at(1) == "debug")
        {
            w.debug();
        }
    }
    else
        w.processAnalyze();

    return a.exec();
}
